package itheima.zuoye.Test1;

public class test {
    public static int getPeachCount(int n) {
        // 递归终止条件
        if (n == 10) {
            return 1;
        } else {
            // 递归计算前一天的桃子数量
            return (getPeachCount(n + 1) + 1) * 2;
        }
    }

    public static void main(String[] args) {


        int firstDayPeachCount = getPeachCount(1);
        System.out.println("猴子第一天摘了 " + firstDayPeachCount + " 个桃子。");
    }
}